package com.xs.project.controller;

import com.xs.project.common.Result;
import com.xs.project.pojo.vo.ExamListReq;
import com.xs.project.pojo.vo.ExamTitleInsertReq;
import com.xs.project.pojo.vo.ExamTitleReq;
import com.xs.project.pojo.vo.resp.ExamTitleResp;
import com.xs.project.pojo.vo.resp.XsExamResp;
import com.xs.project.service.ExamTitleService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/examTitleManager")
@Api(tags = "考试题目管理")
public class ExamTitleManageController {
    @Resource
    private ExamTitleService examTitleService;
    @ApiOperation(value = "列表-题目列表", notes = "考试列表")
    @PostMapping(value = "/selectTitleExamList")
    public Result<List<ExamTitleResp>> selectTitleExamList(@RequestBody ExamTitleReq request) {
        return examTitleService.selectTitleExamList(request);
    }

    @ApiOperation(value = "新增-题目列表", notes = "考试列表")
    @PostMapping(value = "/insertTitleExamList")
    public Result<Boolean> insertTitleExamList(@RequestBody ExamTitleInsertReq request) {
        return examTitleService.insertTitleExamList(request);
    }

    @ApiOperation(value = "更新-题目列表", notes = "考试列表")
    @PostMapping(value = "/updateTitleExamList")
    public Result<Boolean> updateTitleExamList(@RequestBody ExamTitleInsertReq request) {
        return examTitleService.updateTitleExamList(request);
    }

    @ApiOperation(value = "删除-题目列表", notes = "考试列表")
    @PostMapping(value = "/delTitleExamList")
    public Result<Boolean> delTitleExamList(@RequestBody ExamTitleInsertReq request) {
        return examTitleService.delTitleExamList(request.getId());
    }
}
